home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / VPAL10.ZIP / VGAPAL.DOC < prev    next >
Text File  |  1993-01-21  |  10KB  |  294 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.                                 VGApal v1.0
  7.  
  8.                 Copyright (c) 1992 RAM Software Development
  9.  
  10.  
  11.  
  12.                                 Roger Madore
  13.                           RAM Software Development
  14.                                P.O. Box 2193
  15.                          Augusta, Maine, 04338-2193
  16.                            Voice: (207) 623-9248
  17.                              CIS: 71163,214
  18.  
  19.  
  20.                                                                   Page 1
  21.  
  22.  
  23.  
  24.  
  25.                            --------------------
  26.                             Welcome to VGApal!
  27.                            --------------------
  28.  
  29.  
  30.  
  31.                                  Contents
  32.                                  --------
  33.  
  34.  
  35.                            2 - Introduction
  36.                            2 - Installation
  37.                            3 - Fading
  38.                            4 - Scrolling
  39.                            5 - Miscellaneous
  40.                            6 - List of Procedures
  41.                            7 - Legal Information
  42.  
  43.  
  44.                                                                   Page 2
  45.  
  46.  
  47.  
  48.          INTRODUCTION
  49.  
  50.          Have you ever wanted to be able to create professional looking
  51.      fade in and fade out effects? How about palette cycling? Sounds simple,
  52.      but in Pascal, all you end up with is a screen full of "flicker".
  53.  
  54.          How about loading PCX files? Now there is something that would make
  55.      life easier than having to redraw graphic screens every time you wanted
  56.      to display something.
  57.  
  58.          Finally, there is an answer to those problems, and many more.
  59.      Fading in, fading out, to either black or white, is a snap! In three
  60.      easy steps you can load a PCX file and fade in from black, at whatever
  61.      speed you want! Manipulating palette colors and cycling is a breeze,
  62.      and all flicker free!
  63.  
  64.          VGApal is the perfect compliment to any Pascal graphic toolbox.
  65.      From games and demos to graphic presentations, VGApal will make an
  66.      excellent program outstanding!
  67.  
  68.  
  69.  
  70.          INSTALLATION
  71.  
  72.          All you need to do is to include VGApal in your Unit Directories
  73.      under your Options menu.  Then just put "VGApal" in your "Uses" clause
  74.      at the beginning of your program, and you're ready to use the toolkit!
  75.  
  76.  
  77.  
  78.                                                                   Page 3
  79.  
  80.  
  81.  
  82.          FADING
  83.  
  84.          There are many different methods of fading. You can fade in and
  85.      fade out from either white or black. You can also fade from one color
  86.      to another.
  87.  
  88.          Six procedures handle the full palette fading.
  89.  
  90.          SetPalBlack;
  91.          SetPalWhite;
  92.          FadeInPalBlack(Speed : Integer);
  93.          FadeInPalWhite(Speed : Integer);
  94.          FadeOutPalBlack(Speed : Integer);
  95.          FadeOutPalWhite(Speed : Integer);
  96.  
  97.          SetPalBlack or SetPalWhite should be called before using any of the
  98.      other fading procedures. This saves the current palette information into
  99.      an array and sets the "visible" colors to either black or white. At this
  100.      point, you can either draw your screen or load a PCX file without
  101.      anything being shown. REMEMBER: Even though all the palette colors are
  102.      either black or white, their original colors are preserved, and will be
  103.      restored when you use a fading procedure.
  104.  
  105.          Now you can fade in from black or white using FadeInPalBlack or
  106.      FadeInPalWhite. Speed can be an integer from 1 to 100. The higher the
  107.      number, the slower the fade in. If you want the image to "pop" up on the
  108.      screen, set the speed to 1.
  109.  
  110.          Fading out is just as easy. Speed determines the speed at which the
  111.      the palette fades to black or white. The actual palette will still be
  112.      preserved in the array that was constructed with SetPalBlack or
  113.      SetPalWhite.
  114.  
  115.          NOTE: No error checking is performed in the Speed variable. This
  116.      was for speed considerations. You can use larger numbers, but you may
  117.      get unpredictable results!
  118.  
  119.          For a quick example, your code could be something like this:
  120.  
  121.          Program Sample;
  122.          Uses Graph, VGApal;
  123.          {VGA 320 x 200 initialization code}
  124.          SetPalBlack;
  125.          {Draw or load images}
  126.          FadeInPalBlack(15);
  127.          {Perform other functions}
  128.          FadeOutPalBlack(80);
  129.          End.
  130.  
  131.  
  132.  
  133.                                                                   Page 4
  134.  
  135.  
  136.  
  137.          SCROLLING
  138.  
  139.          Palette scrolling can create some of the most impressive animation
  140.      sequences ever. VGApal offers five palette scrolling procedures that are
  141.      fast and easy to use.
  142.  
  143.          CyclePalAhead;
  144.          CyclePalBack;
  145.          CycleColAhead(First, Last : Integer);
  146.          CycleColBack(First, Last : Integer);
  147.          SwitchCol(First, Second : Integer);
  148.  
  149.          CyclePalAhead and CyclePalBack scrolls the entire palette by shifting
  150.      all the colors in the palette table by increments of one. The color that
  151.      scrolls off of the end wraps to the other. For example, if you execute
  152.      CyclePalAhead:
  153.  
  154.          0,1,2...253,254,255    would become    255,0,1...252,253,254
  155.  
  156.          CyclePalAhead and CyclePalBack only shift the palette once per call.
  157.      You would have to create a loop to have continuous palette cycling.
  158.  
  159.          CycleColAhead and CycleColBack work the same as CyclePalAhead and
  160.      CyclePalBack, except that you specify the range of colors that are
  161.      cycled. So if you execute CycleColAhead(3,7):
  162.  
  163.          0,1,2,3,4,5,6,7,8,9    would become    0,1,2,7,3,4,5,6,8,9
  164.  
  165.          SwitchCol is very straight forward. Just specify the two colors to
  166.      switch. For instance, SwitchCol(3,8):
  167.  
  168.          0,1,2,3,4,5,6,7,8,9    would become    0,1,2,8,4,5,6,7,3,9
  169.  
  170.  
  171.  
  172.                                                                   Page 5
  173.  
  174.  
  175.  
  176.          MISCELLANEOUS
  177.  
  178.          A few procedures just didn't seem to fit into any other category,
  179.      but they are no less impressive!
  180.  
  181.          SaveColorFrom(Color : Integer);
  182.          FadeColorTo(Color, Speed : Integer);
  183.          SavePal;
  184.          RestPal;
  185.          Read256PCX(Filename : PathStr);
  186.  
  187.          SaveColorFrom will save the RGB information from the specified color
  188.      into the array SColor[0..2]. This function is useful if you want to
  189.      retrieve color information quickly, and is also used in FadeColorTo.
  190.      The SColor[0..2] array can be manipulated directly by your program, and
  191.      can be helpful if you need to use a color that doesn't already exist.
  192.  
  193.          FadeColorTo will take the color information in SColor[0..2], and
  194.      smoothly fade it into the specified color, at the predefined speed.
  195.      Some spectacular results can be realized with these two procedures.
  196.  
  197.          SavePal does just as it implies. It saves your current palette in an
  198.      array. Its compliment is RestPal, which restores all the palette colors
  199.      to the previously save colors.
  200.  
  201.          Read256PCX reads a 320 x 200 with 256 colors PCX file directly into
  202.      memory. It is displayed very quickly, and has superb results with the
  203.      fading procedures.
  204.  
  205.          NOTE: There is not any error checking done for these procedures.
  206.      Error handling is left up to the individual programmer.
  207.  
  208.  
  209.  
  210.                                                                   Page 6
  211.  
  212.  
  213.  
  214.          LIST OF PROCEDURES
  215.  
  216.  
  217.          CycleColAhead(First, Last : Integer);
  218.             Cycles colors ahead from First color to Last color.
  219.  
  220.          CycleColBack(First, Last : Integer);
  221.             Cycles colors backwards from First color to Last color.
  222.  
  223.          CyclePalAhead;
  224.             Cycles the entire palette ahead.
  225.  
  226.          CyclePalBack;
  227.             Cycles the entire palette backwards.
  228.  
  229.          FadeColorTo(Color, Speed : Integer);
  230.             Fades colors from SColor[0..2] to Color at Speed.
  231.  
  232.          FadeInPalBlack(Speed : Integer);
  233.             Fades in from black to colors saved in SetPalBlack or
  234.             SetPalWhite at Speed.
  235.  
  236.          FadeInPalWhite(Speed : Integer);
  237.             Fades in from white to colors saved in SetPalBlack or
  238.             SetPalWhite at Speed.
  239.  
  240.          FadeOutPalBlack(Speed : Integer);
  241.             Fades current palette out to black.
  242.  
  243.          FadeOutPalWhite(Speed : Integer);
  244.             Fades current palette out to white.
  245.  
  246.          Read256PCX(Filename : PathStr);
  247.             Reads a 320 x 200 with 256 colors PCX file into memory.
  248.  
  249.          RestPal;
  250.             Restores the palette saved with SavePal.
  251.  
  252.          SaveColorFrom(Color : Integer);
  253.             Saves palette information of Color into SColor[0..2].
  254.  
  255.          SavePal;
  256.             Saves current palette information into an array.
  257.  
  258.          SetPalBlack;
  259.             Sets all colors to black and saves current colors to an array.
  260.  
  261.          SetPalWhite;
  262.             Sets all colors to white and saves current colors to an array.
  263.  
  264.          SwitchCol(First, Second : Integer);
  265.             Switches color First with color Second.
  266.  
  267.  
  268.  
  269.                                                                   Page 7
  270.  
  271.  
  272.  
  273.          LEGAL INFORMATION
  274.  
  275.          VGA256.BGI is included for the sole purpose of free
  276.      distribution to Turbo Pascal users. None of the registration
  277.      fee for VGApal is for VGA256.BGI. At the end of the evaluation
  278.      of VGApal, the user is free to keep VGA256.BGI. VGA256.BGI is
  279.      distributed by Borland International free of charge.
  280.  
  281.          VGApal is being released "AS IS" as shareware. RAM
  282.      Software Development will not assume any responsibility for
  283.      damages and loss of profit, and will not provide any expressed
  284.      or implied warranties. Use this software at your own risk.
  285.  
  286.          See VENDOR.DOC for distribtution policies, and REGISTER.DOC
  287.      for registration policies.
  288.  
  289.      Turbo Pascal is a registered trademark of Borland International
  290.  
  291.  
  292.           VGApal    Copyright (c) 1992, RAM Software Development
  293.  
  294.